<template>
  <el-form
    label-width="100px"
    class="container"
  >
    <el-form-item label="邮箱" >
      <el-input
      type="email"
        v-model="email"
        placeholder="Enter Email..."
      ></el-input>
    </el-form-item>
    <el-form-item>
      <el-button
        @click="handlePasswork()"
        type="primary"
        class="submit-btn"
        >找回密码</el-button
      >
    </el-form-item>
  </el-form>
</template>

<script lang="ts">
import {ref, getCurrentInstance } from "vue";
import { useRouter } from "vue-router";
export default {
  setup() {
    console.log(getCurrentInstance());
    // @ts-ignore
    const { ctx } = getCurrentInstance();
    const  router  =useRouter() 
    const email =ref<string>("")
    const  handlePasswork = async () =>{
      const res =  await ctx.$axios.post('api/v1/auth/forgotpassword',{email:email.value})
    }
    return { handlePasswork,email };
  },
};
</script>
<style scoped>
.container{
  width: 50%;
  margin: 200px auto;
}
.submit-btn {
  width: 100%;
}
.tiparea {
  text-align: right;
  font-size: 12px;
  color: #333;
}
.tiparea p a {
  color: #409eff;
}
</style>